-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_parse: Remove Parser::normalized(_prev)_token
#69801
Conversation
@bors try |
⌛ Trying commit f572d400edc7f52ce6597f359b291dc1322de3c7 with merge ac2bf9054006fee0f39772b8daad9845a9fa570f... |
☀️ Try build successful - checks-azure |
@rust-timer queue |
Awaiting bors try build completion |
@rust-timer build ac2bf9054006fee0f39772b8daad9845a9fa570f |
Queued ac2bf9054006fee0f39772b8daad9845a9fa570f with parent a039217, future comparison URL. |
Finished benchmarking try commit ac2bf9054006fee0f39772b8daad9845a9fa570f, comparison URL. |
Haven't reviewed the PR yet, but those numbers seem like a slight regression overall, although with some improvements? |
I expected the perf diff to be within the noise. @bors try @rust-timer queue |
Awaiting bors try build completion |
☀️ Try build successful - checks-azure |
Queued 5f66c2a with parent f943349, future comparison URL. |
Finished benchmarking try commit 5f66c2a, comparison URL. |
Yeah, the perf diff is noise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with these comments considered.
@@ -714,6 +726,24 @@ pub enum Nonterminal { | |||
#[cfg(target_arch = "x86_64")] | |||
rustc_data_structures::static_assert_size!(Nonterminal, 40); | |||
|
|||
impl Nonterminal { | |||
fn span(&self) -> Span { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add trait HasSpan { ... }
for this. I've felt the need for it in reviewing / writing other PRs as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe.
It's not too helpful for this PR though because all the uses of spans are concrete.
I'm not sure where exactly it would be useful, actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly where you have slices of objects with spans, and you want to have "first to last"; it seems to occur sometimes. I agree though that for the purposes of this PR it doesn't add much, so let's defer this to some other PR. :)
Updated. |
@bors r+ |
📌 Commit 7a30bb1 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
Rollup of 6 pull requests Successful merges: - #69201 (Permit attributes on 'if' expressions) - #69685 (unix: Don't override existing SIGSEGV/BUS handlers) - #69762 (Ensure that validity only raises validity errors) - #69779 (librustc_codegen_llvm: Use slices in preference to 0-terminated strings) - #69801 (rustc_parse: Remove `Parser::normalized(_prev)_token`) - #69842 (Add more regression tests) Failed merges: r? @ghost
parse: Tweak the function parameter edition check Follow-up to rust-lang#69801. Edition of a code fragment is inferred from "the place where the code is written". For individual tokens like edition-specific keywords it may be the span of the token itself ("uninterpolated" span), but for larger code fragments it's probably not, in the test example the trait method is obviously written in "2015 edition code". r? @Centril
parse: Tweak the function parameter edition check Follow-up to rust-lang#69801. Edition of a code fragment is inferred from "the place where the code is written". For individual tokens like edition-specific keywords it may be the span of the token itself ("uninterpolated" span), but for larger code fragments it's probably not, in the test example the trait method is obviously written in "2015 edition code". r? @Centril
Perform the "normalization" (renamed to "uninterpolation") on the fly when necessary.
The final part of #69579 #69384 #69376 #69211 #69034 #69006.
r? @Centril